import { PropType, Recordable } from '@/global'
import { ColEx } from './types'
import { FormSchema } from './types/form'
import _Button from 'element-plus/lib/el-button/index'

export const basicProps = {
  // 表单数据对象
  model: {
    type: Object as PropType<Recordable>,
    default: {}
  },
  // 校验
  rules: {
    type: Object as PropType<Recordable>,
    default: {}
  },
  // 表单域标签的宽度
  labelWidth: {
    type: String as PropType<string>,
    default: '0px'
  },
  // 是否在输入框中显示校验结果反馈图标
  statusIcon: {
    type: Boolean as PropType<boolean>,
    default: false
  },
  // 用于控制该表单内组件的尺寸
  size: {
    type: String as PropType<'medium' | 'small' | 'mini'>,
    default: 'medium'
  },
  // 是否禁用该表单内的所有组件
  disabled: {
    type: Boolean as PropType<boolean>,
    default: false
  },
  // 配置表单
  schemas: {
    type: [Array] as PropType<FormSchema[]>,
    default: () => []
  },
  baseColProps: {
    type: Object as PropType<Partial<ColEx>>
  },
  // 操作列Col配置
  actionColOptions: Object as PropType<Partial<ColEx>>,
  // 是否显示操作按钮
  showActionButtonGroup: {
    type: Boolean as PropType<boolean>,
    default: true
  },
  // 显示重置按钮
  showResetButton: {
    type: Boolean as PropType<boolean>,
    default: true
  },
  // 重置按钮配置
  resetButtonOptions: Object as PropType<Partial<typeof _Button>>,
  // 显示确认按钮
  showSubmitButton: {
    type: Boolean as PropType<boolean>,
    default: true
  },
  // 确认按钮配置
  submitButtonOptions: Object as PropType<Partial<typeof _Button>>
}
